import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { environment } from '@env/environment';

import { PassportComponent } from '../frame/passport/passport.component';
import { LayoutComponent } from '../frame/layout/layout.component';
import { Exception404Component } from '../frame/exception/404.component';

import { HomeComponent } from './home/home.component';

const routes: Routes = [
  {
    path: '',
    component: LayoutComponent,
    children: [
      { path: '', redirectTo: '/passport', pathMatch: 'full' },
      { path: 'home', component: HomeComponent },
      { path: 'system', loadChildren: './system/system.module#SystemModule' },
      // {
      //   path: 'cloud-gate',
      //   children: [
      //     { path: 'job-management', loadChildren: './cloud-gate/job-management/job-management.module#JobManagementModule' },
      //     { path: 'operation-management', loadChildren: './cloud-gate/operation-management/operation-management.module#OperationManagementModule' }
      //   ]
      // }
    ],
  },
  { path: 'passport', component: PassportComponent },
  { path: '404', component: Exception404Component },
  { path: '**', redirectTo: '404' }
];

@NgModule({
  imports: [RouterModule.forRoot(routes, { useHash: environment.useHash })],
  exports: [RouterModule],
})
export class RouteRoutingModule { }
